/*
 * @Description:: 请补充填写
 * @Version: 1.0
 * @Author: 小白
 * @Date: 2022-04-15 09:33:46
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-04-23 11:42:32
 * @FilePath: \vite-admin\src\plugins\cookie.ts
 */
import Cookies from 'js-cookie'

const TokenKey = 'token'
const RefreshTokenKey = 'refresh-token'

export function getToken () {
  return Cookies.get(TokenKey)
}
export function getTokenKey () {
  return TokenKey
}
export function getRefreshTokenKey () {
  return RefreshTokenKey
}

export function setToken (token: any) {
  return Cookies.set(TokenKey, token)
}

export function getRefreshToken () {
  return Cookies.get(RefreshTokenKey)
}

export function setRefreshToken (refreshToken: any) {
  return Cookies.set(RefreshTokenKey, refreshToken)
}
export function removeToken () {
  Cookies.remove(TokenKey)
  Cookies.remove(RefreshTokenKey)
}
